/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mybean;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Phu
 */
public class ConnectDBFactory {
    public static Connection getConnection() throws ClassNotFoundException, SQLException {
        String connectionURL = "jdbc:sqlserver://localhost:1433;databaseName=BookStore;user=sa;password=sa";
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        Connection con = DriverManager.getConnection(connectionURL);
        return con;
    }
}
